<template>
  <div>我是props组件</div>
  <span>{{ props.title }}</span>
</template>

<script lang="ts" setup>
import { onMounted, onUnmounted } from 'vue'
import emitter from '../utils/mitt'
const props = withDefaults(defineProps<{
  title: string
}>(), {

})

onMounted(() => {
  emitter.on('props-1', (data) => {
    console.log('接受到了', data);
  })
})

onUnmounted(() => {
  emitter.off('props-1')
})
</script>
